//  Copyright 2009 Regents of the University of Minnesota
#import "Constants.h"

// XML Elements
NSString * const kElementGame = @"game";
NSString * const kElementPuzzle = @"puzzle";
NSString * const kElementImage = @"image";
NSString * const kElementPerspective = @"perspective";
NSString * const kElementTiles = @"tiles";
NSString * const kElementFact = @"fact";

// Game Attributes
NSString * const kGameScore = @"score";
NSString * const kGamePlayerX = @"playerX";
NSString * const kGamePlayerY = @"playerY";
NSString * const kGameTitle = @"title";
NSString * const kGameImagePath = @"path";
NSString * const kGameSize = @"size";
int        const kGameNumberOfAnswerOptions = 4;
int		   const kGameSaveVersion = 2;
NSString * const kGameSaveVersionKey = @"version";
NSString * const kGameAskingQuestionKey = @"askingQuestion";

// Gameplay
int        const kGameScoreMovementDecrement = 10;
int        const kGameScoreQuestionCorrectIncrement = 25;

// Perspective Attributes
NSString * const kPerspectiveName = @"name";
NSString * const kPerspectiveLabel = @"label";
NSString * const kPerspectiveImagePath = @"image";
NSString * const kPerspectiveAnswers = @"answers";

// Tile Attributes
NSString * const kTileQuestion = @"question";
NSString * const kTileAnswer = @"answer";

// Tile Settings
NSString * const kTilePerspective = @"perspective";
NSString * const kTilePerspectiveBlank = @"blank";
NSString * const kTilePerspectiveStart = @"start";
NSString * const kTilePerspectiveFinish = @"finish";

// Tile Status
NSString * const kTileStatus = @"status";
NSString * const kTileStatusUnanswered = @"unanswered";
NSString * const kTileStatusAnsweredCorrectly = @"correct";
NSString * const kTileStatusAnsweredIncorrectly = @"incorrect";

// Animation Related
float      const kPlayerStarAnimationInterval = 0.5;
float      const kArrowFadeAnimationInterval = 2.5;
float      const kQuestionArrowMinimumAlpha = 0.3;

// Question Related
float      const kDefaultTextColorRed = 0.11;
float      const kDefaultTextColorGreen = 0.14;
float      const kDefaultTextColorBlue = 0.2;
float      const kAnswerAnimationInterval = 1.0;

int randomSort(id one, id two, void *context)
{
	int num = arc4random() % 2;
	return num == 1 ? NSOrderedAscending : NSOrderedDescending;
}
